import Phaser from "phaser";

export default class Home extends Phaser.Scene {
    constructor() {
        super("home");
    }
    preload() {
        // 设置背景颜色为蓝色
        this.cameras.main.setBackgroundColor(0xa8d4bf);
        let startIcon = this.add.text(this.cameras.main.width / 2, this.cameras.main.height / 2, "开始")
            .setOrigin(0.5);
        // 为 startIcon 添加交互事件，使其可点击
        startIcon.setInteractive();
        startIcon.on('pointerover', () => {
            startIcon.setColor('#FF0000'); // 悬停时将字体颜色变更为红色
        });
        startIcon.on('pointerdown', () => {
            this.children.removeAll(true);
            // 可在此处添加点击后的具体逻辑
            this.scene.start("battle");
        });
    }
    create() {
    }
}
